package com.task.src.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.task.src.dto.Task;
import com.task.src.dto.TaskDto;
import com.task.src.mapper.TaskMapper;
import com.task.src.service.TaskService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
import java.util.Map;

@Service
public class TaskServiceImpl implements TaskService {
    @Resource
    private TaskMapper taskMapper;

    @Override
    public PageInfo<List<Task>> selectAllTask(int pageNum,int pageSize,int uid) {
        PageHelper.startPage(pageNum,pageSize);
        List<Task> list=taskMapper.selectAllTask(uid);
        PageInfo<List<Task>> pageInfo=new PageInfo(list);
        return pageInfo;
    }

    @Override
    public int updateType(int taskid) {
        return taskMapper.updateType(taskid);
    }

    @Override
    public List<Task> selectTaskDto(String name,String uid) {
        return taskMapper.selectTaskDto(name,uid);
    }

    @Override
    public int insertPubTask(Task task) {
        return taskMapper.insertPubTask(task);
    }
}
